//
//  SHYSchemaRouterNode.m
//  Pods
//
//  Created by sunhaiyan on 16/6/17.
//
//

#import "SHYSchemaRouterNode.h"
#import "SHYValidJudge.h"

@implementation SHYSchemaRouterNode

- (instancetype)initWithSchemeTabName:(NSString *)tabName moduleName:(NSString *)moduleName paramDict:(NSDictionary *)paramDict controllerClassName:(NSString *)controllerClassName {
    self = [super init];
    if (self) {
        if (![SHYValidJudge isValidString:tabName]) {
            // tab 名字为空表示在当前tab上进行跳转
            tabName = @"current";
        }
        if (![SHYValidJudge isValidString:moduleName]) {
            NSAssert(NO, @"module名称不能为空，创建SchemaRouterNode失败");
            return nil;
        }
        _schemaModuleName = [moduleName copy];
        _schemaTabName = [tabName copy];
        _paramDict = [paramDict copy];
        _controllerClassName = [controllerClassName copy];
    }
    return self;
}

- (NSString *)description {
    return  [NSString stringWithFormat:@"%@",[self toDictionary]];
}

@end
